CarExtender
Helper class to add Android Auto extensions to notifications. To create a notification with car extensions:
- Create an NotificationCompat.Builder, setting any desired properties.
- Create a CarExtender.
- Set car-specific properties using the
add
andset
methods of CarExtender. - Call extend to apply the extensions to a notification.
- Post the notification to the notification system with the
NotificationManagerCompat.notify(...)
methods and not theNotificationManager.notify(...)
methods.
Notification notification = new NotificationCompat.Builder(context)
...
.extend(new CarExtender()
.set*(...))
.build();
Content copied to clipboard
Car extensions can be accessed on an existing notification by using the CarExtender(Notification)
constructor, and then using the get
methods to access values.
Constructors
Link copied to clipboard
constructor()
Create a CarExtender with default options.
Create a CarExtender from the CarExtender options of an existing Notification.
Functions
Link copied to clipboard
Apply car extensions to a notification that is being built.
Link copied to clipboard
Gets the large icon used in this car notification, or null if no icon has been set.
Link copied to clipboard
Returns the unread conversation conveyed by this notification.
Link copied to clipboard
Sets the large icon of the car notification.
Link copied to clipboard
open fun setUnreadConversation(@Nullable unreadConversation: NotificationCompat.CarExtender.UnreadConversation): NotificationCompat.CarExtender
Sets the unread conversation in a message notification.